﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Browser check.</title>
    </head>
    <script type="text/javascript">
        var JSON;
        JSON || (JSON = {}),
function () {
    function f(a) {
        return a < 10 ? "0" + a : a
    }
    function quote(a) {
        return escapable.lastIndex = 0,
        escapable.test(a) ? '"' + a.replace(escapable,
        function (a) {
            var b = meta[a];
            return typeof b == "string" ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
        }) + '"' : '"' + a + '"'
    }
    function str(a, b) {
        var c, d, e, f, g = gap,
        h, i = b[a];
        i && typeof i == "object" && typeof i.toJSON == "function" && (i = i.toJSON(a)),
        typeof rep == "function" && (i = rep.call(b, a, i));
        switch (typeof i) {
            case "string":
                return quote(i);
            case "number":
                return isFinite(i) ? String(i) : "null";
            case "boolean":
            case "null":
                return String(i);
            case "object":
                if (!i) return "null";
                gap += indent,
            h = [];
                if (Object.prototype.toString.apply(i) === "[object Array]") {
                    f = i.length;
                    for (c = 0; c < f; c += 1) h[c] = str(c, i) || "null";
                    return e = h.length === 0 ? "[]" : gap ? "[\n" + gap + h.join(",\n" + gap) + "\n" + g + "]" : "[" + h.join(",") + "]",
                gap = g,
                e
                }
                if (rep && typeof rep == "object") {
                    f = rep.length;
                    for (c = 0; c < f; c += 1) typeof rep[c] == "string" && (d = rep[c], e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e))
                } else for (d in i) Object.prototype.hasOwnProperty.call(i, d) && (e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e));
                return e = h.length === 0 ? "{}" : gap ? "{\n" + gap + h.join(",\n" + gap) + "\n" + g + "}" : "{" + h.join(",") + "}",
            gap = g,
            e
        }
    }
    "use strict",
    typeof Date.prototype.toJSON != "function" && (Date.prototype.toJSON = function (a) {
        return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
    },
    String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (a) {
        return this.valueOf()
    });
    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    gap, indent, meta = {
        "\b": "\\b",
        "\t": "\\t",
        "\n": "\\n",
        "\f": "\\f",
        "\r": "\\r",
        '"': '\\"',
        "\\": "\\\\"
    },
    rep;
    typeof JSON.stringify != "function" && (JSON.stringify = function (a, b, c) {
        var d;
        gap = "",
        indent = "";
        if (typeof c == "number") for (d = 0; d < c; d += 1) indent += " ";
        else typeof c == "string" && (indent = c);
        rep = b;
        if (!b || typeof b == "function" || typeof b == "object" && typeof b.length == "number") return str("", {
            "": a
        });
        throw new Error("JSON.stringify");
    }),
    typeof JSON.parse != "function" && (JSON.parse = function (text, reviver) {
        function walk(a, b) {
            var c, d, e = a[b];
            if (e && typeof e == "object") for (c in e) Object.prototype.hasOwnProperty.call(e, c) && (d = walk(e, c), d !== undefined ? e[c] = d : delete e[c]);
            return reviver.call(a, b, e)
        }
        var j;
        text = String(text),
        cx.lastIndex = 0,
        cx.test(text) && (text = text.replace(cx,
        function (a) {
            return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
        }));
        if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + text + ")"),
        typeof reviver == "function" ? walk({
            "": j
        },
        "") : j;
        throw new SyntaxError("JSON.parse");
    })
} ();
    </script>
<body>
    检测中南院子域名的配置情况：<br />
    1、是否允许执行JavaScript；<br />
    2、是否已经加入受信任站点；<br />
    3、ActiveX控件检测；<br />
    检测完成后返回JSON，如果全部通过则写入 Cookies：_browserCheckResult=1<br/>

    <script type="text/javascript">
        var StatusNG = 0;
        var StatusUP = 1;
        var StatusOK = 2;

        var CheckResult = []; //检测结果
        
        //检查信任站点
        var trustWebsiteStatus = StatusNG;
        try {
            var WshShell = new ActiveXObject("WScript.Shell");
            trustWebsiteStatus = StatusOK;
            var result = { key: 'TrustWebsite', value: 1 };
            CheckResult.push(result);
        }
        catch (e) {
            trustWebsiteStatus = StatusNG;
            var result = { key: 'TrustWebsite', value: 0 };
            CheckResult.push(result);
        }
        
        //弹窗设置检测
        var popupStatus = StatusNG;
        var str_feature = 'toolbar=no' + ',menubar=no' + ',scrollbars=no' + ',resizable=no' + ',status=no' + ',width=1' + ',height=1' + ',top=0' + ',left=0' + ',screenX=0' + ',screenY=0';
        var popup_win = window.open("BrowserCheckClose.html", "wb_check", str_feature);
        if (popup_win) {
            popupStatus = StatusOK;
            var result = { key: 'Popup', value: 1 };
            CheckResult.push(result);
        }else {
            var result = { key: 'Popup', value: 0 };
            CheckResult.push(result);
        }

        //ActiveX控件检测
        //针对MIS系统：MIS旧版附件上传插件、MIS旧版在线文件编辑、Sliverlight控件、Flash插件
        //金格产品：金格签章插件、金格全文批注插件
        //RTX：RTX SSO插件
        //关于AD：AD自动登录调用

        //组装检测的结果,JSON
//        if(trustWebsiteStatus) {
//            CheckResult += "{key:'TrustWebsite',value:1}";
//        } else {
//            CheckResult += "{key:'TrustWebsite',value:0}";
//        }
//        CheckResult += ",";

//        if (popupStatus) {
//            CheckResult += "{key:'Popup',value:1}";
//        } else {
//            CheckResult += "{key:'Popup',value:0}";
//        }
//        CheckResult += "}";
        
        window.name = JSON.stringify(CheckResult); // 这里是要传输的数据，大小一般为2M，IE和firefox下可以大至32M左右
        // 数据格式可以自定义，如json、字符串
        if (window.parent && window.parent == window)
            alert(window.name);
    </script>
</body>
</html>
